
import { resolve } from 'path';
import { ESLint } from 'eslint';

const eslint = new ESLint({
    fix: true,
    extensions: [".js", ".vue"],
    useEslintrc: false,
    overrideConfig: {
        "env": {
            "browser": true,
            "es2021": true
        },
        "extends": [
            "eslint:recommended",
            "plugin:vue/essential"
        ],
        "parserOptions": {
            "ecmaVersion": 13,
            "sourceType": "module"
        },
        "plugins": [
            "vue"
        ],
        "rules": {
        }
    },
    resolvePluginsRelativeTo: resolve(process.cwd(), 'node_modules') // 指定 loader 加载路径
});

export const lint = async (path = 'src') => {
    console.log(resolve(process.cwd(), path))
    return Promise.resolve();
}
